package com.example.ali.controller;

import com.example.ali.domain.dto.MyDetectionDto;
import com.example.ali.service.IAliOcrService;
import com.example.ali.service.IMyDeteionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 〈〉
 *
 * @author hero
 * @create 2024/5/29
 * @since 1.0.0
 */
@RestController
@RequestMapping("/ocr")
@CrossOrigin(origins = "*")
public class AliOcrController {

    @Autowired
    IMyDeteionService myDeteionService;

    @PostMapping("/demo")
    public List<MyDetectionDto> getOcrRes(@RequestParam MultipartFile file) throws Exception {
        return myDeteionService.getOcrRes(file.getInputStream());
    }






}